<div class="category-head">
	<h2>Sản Phẩm Mới</h2>
</div>


<?php if ($products) { ?>
<div class="listing-type-grid  catalog-listing padder"> <!-- the class name will change to .listing-type-cell if viewing in list mode -->
	<?php foreach ($products as $pro){?>
	<div class="thumb-show">
		<h5><a href="<?php echo $pro['href'];?>" title="Đi Chợ Thuê Sài Gòn:<?php echo $pro['name'];?>"><?php echo $pro['name'];?></a></h5>
		<div class="d4-product-bg">
			<a href="<?php echo $pro['href'];?>">
				<img id="image<?php echo $pro['id']; ?>" src="<?php if($pro['thumb']!=""){ ?><?php echo $pro['thumb']; ?><?php }else{?>image/no_image.jpg<?php }?>" title="Đi Chợ Thuê Sài Gòn:<?php echo $pro['name'];?>" width="131" height="131" />
			</a>
			<div class="price-box">
				<span class="regular-price" id="product-price-368"><span class="price"><?php echo substr($pro['price'],2) ; ?> VNĐ</span> / <?php echo $pro['unit']; ?></span> <!-- thay đổi đơn vị tính theo db -->
			</div>
		</div>
		<form id="product<?php echo $pro['id']; ?>" enctype="multipart/form-data" method="post" action="index.php?route=checkout/cart">
			<div class="price-box">
				<span class="regular-price" style="top:-10px;position:relative;">Số lượng : <input name="quantity" type="text" value="01" style="width:32px;" onkeypress="return numbersonly(this, event);" maxlength="4"/></span>
				<a href="javascript:;" id="add_to_cart" ><img onclick="addtocart(<?php echo $pro['id']; ?>);" src="catalog/view/theme/default/images/d4-btn-buy.png" alt="Add to Cart" height="28" width="53"/></a>
			</div> 
			<input type="hidden" name="product_id" value="<?php echo $pro['id']; ?>" />
            <input type="hidden" name="redirect" value="" />      
		</form>		
 
	</div>
	<?php }?>		
<div class="clear"></div>
</div>
<script type="text/javascript">
<!--
function numbersonly(myfield, e)
{
var key;
var keychar;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
// control keys
if ((key==null) || (key==0) || (key==8) ||
(key==9) || (key==27) || (key==13) || (key==46))
return true;
// numbers
else if ((("0123456789").indexOf(keychar) > -1))
return true;
// decimal point jump
else
return false;
}
//-->
</script>  
<?php }?>